package com.advertise.login.action;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.advertise.login.model.LoginModel;


@Controller
public class LoginController {

	
	@RequestMapping("loginMapJson.action")
	@ResponseBody
	public Map<String,Object> loginMapJson() {
		Map<String,Object> map = new HashMap<String,Object>();  
        map.put("code", true);  
        return map;  
	}
	
	@RequestMapping("loginObjJson.action")
	@ResponseBody
	public LoginModel loginObjJson() {
		LoginModel lm = new LoginModel();
		lm.setUserCode("henry");
		lm.setUserPass("linda");
		return lm;
	}
	
	@RequestMapping("loginListJson.action")
	@ResponseBody
	public List<LoginModel> loginListJson() {
		List<LoginModel> list = new ArrayList<LoginModel>();
		LoginModel lm = new LoginModel();
		lm.setUserCode("henry");
		lm.setUserPass("linda");
		LoginModel lm2 = new LoginModel();
		lm2.setUserCode("henry");
		lm2.setUserPass("linda");
		list.add(lm);
		list.add(lm2);
		return list;
	}
}
